package info.rflow.actionproviders;

import info.rflow.graph.RBlockWidget;
import org.netbeans.api.visual.action.EditProvider;
import org.netbeans.api.visual.widget.Widget;

import javax.swing.*;


/**
 * DOCUMENT ME!
 *
 * @author Holger Brandl
 */
public class GraphEditProvider implements EditProvider {

    public void edit(Widget widget) {
        if (!(widget instanceof RBlockWidget))
            return;

        RBlockWidget nodeWidget = (RBlockWidget) widget;
        String s = JOptionPane.showInputDialog("Pleas enter new component name:", nodeWidget.getLabelWidget().getLabel());

        if (s != null && !s.equals(""))
            nodeWidget.setLabel(s);
    }
}
